#include "line.h"

Line::Line(QObject* parent)
	: Shape(parent)
{
}

Line::~Line()
{
}

void Line::drawShape(QPaintDevice* parent)
{
	QPainter painter(parent);
	painter.setRenderHint(QPainter::Antialiasing);
	QTransform transform;
	qreal scaleFactor = getShapeScale();
	transform.scale(scaleFactor, scaleFactor);
	painter.setTransform(transform);
	qreal width = qreal(getBorderWidth());
	Qt::PenStyle borderStyle = getBorderStyle();
	QRgb borderColor = getBorderColor();
	painter.setPen(QPen(QColor(borderColor), width, borderStyle));
	painter.setPen(QPen(QColor(borderColor), width, borderStyle));
	painter.drawLine(getShapeRect().topLeft(), getShapeRect().bottomRight());
}

ShapeType Line::getShapeType()
{
	return ShapeType::LineShapeType;
}